/**
package com.example.springbootkafka.config;

import org.apache.kafka.common.serialization.Serdes;
import org.apache.kafka.streams.KafkaStreams;
import org.apache.kafka.streams.StreamsBuilder;
import org.apache.kafka.streams.StreamsConfig;
import org.apache.kafka.streams.kstream.KStream;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

import java.util.Properties;

@Configuration
public class KafkaStreamConfig {


    @Bean
    public KStream<String, String> kStream() {
        // 配置 Kafka Streams
        Properties props = new Properties();
        props.put(StreamsConfig.APPLICATION_ID_CONFIG, "my-streams-app");
        props.put(StreamsConfig.BOOTSTRAP_SERVERS_CONFIG, "192.168.110.105:9092");
        props.put(StreamsConfig.DEFAULT_KEY_SERDE_CLASS_CONFIG, Serdes.String().getClass().getName());
        props.put(StreamsConfig.DEFAULT_VALUE_SERDE_CLASS_CONFIG, Serdes.String().getClass().getName());


        final StreamsBuilder streamsBuilder = new StreamsBuilder();
        KStream<String, String> source = streamsBuilder.stream("test");
        source.foreach((key, value) -> System.out.println("KafkaStreamConfig kStream message: " + value));
        // 转换消息内容为大写
        KStream<String, String> upperCased = source.mapValues(value -> value.toUpperCase());


        upperCased.to("test");
        KafkaStreams streams = new KafkaStreams(streamsBuilder.build(), props);
        streams.start();
        
        return source;
    }
}
*/
